const mongoose = require('mongoose');
const commodityModel = require('./commodityModel');
const userModel = require('./userModel');
const adminModel = require('./adminModel');
const shopDoorModel = require('./shopDoorModel');

const orderGoodSchema = new mongoose.Schema({
    commoditysId:{
        type: mongoose.Schema.Types.ObjectId,
        ref: commodityModel
    },
    count: Number,
    userId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: userModel
    },
    time: String,
    state: String,
    adminId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: adminModel
    },
    shopDoorId:{
        type: mongoose.Schema.Types.ObjectId,
        ref: shopDoorModel
    }
})

module.exports = mongoose.model('orderGoodModel',orderGoodSchema, 'orderGoods');